package client;

public class MovingBlock extends Block implements MovableBlock {

	private float speed;
	
	public MovingBlock(Position startPosition, Orientation or, float speed) {
		super(startPosition, or);
		this.speed = speed;
	}

	@Override
	public void updatePosition(Tick elapsedTime) {
		this.current.updateY((int)(speed*(float)elapsedTime.tick));
		speed = ClientModel.BASE_SPEED;
	}

	@Override
	public void moveLeft() {
		this.current.updateX(-1);
	}

	@Override
	public void moveRight() {
		this.current.updateX(1);
		
	}

	@Override
	public void rotate() {
		orientation = orientation.next(orientation);
		current.updateOrientation(orientation);
	}

	@Override
	public void scrollDown() {
		speed = 2*speed;
	}

}
